import { getDetailByIdAPI } from '@/api/detail';
import { AppDispatch } from '..';

export const getDetailByIdAction = (id: string) => {
  return async (dispatch: AppDispatch) => {
    const res = await getDetailByIdAPI(id);
    // dispatch触发，数据存入redux中
    dispatch({ type: 'article/saveDetail', payload: res.data });
  };
};
